"""API接口模块
定义所有REST API端点
"""

from flask import Blueprint

# 创建API蓝图
api_bp = Blueprint('api', __name__, url_prefix='/api/v1')

# 导入所有API路由
from . import upload
from . import task
from . import download
from . import user
from . import template
from . import websocket

def init_api(app, socketio):
    """
    初始化API
    
    Args:
        app: Flask应用实例
        socketio: SocketIO实例
    """
    # 注册API蓝图
    app.register_blueprint(api_bp)
    
    # 初始化WebSocket事件
    from .websocket import init_websocket_events
    init_websocket_events(socketio)